﻿namespace dotnet_notes.Reqs
{
    /// <summary>
    /// 列表查询请求模型
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class ListReq<T> where T : new()
    {
        private int pageNumber;
        private int pageSize;

        /// <summary>
        /// 页数(默认 1)
        /// </summary>
        public int PageNumber
        {
            get => pageNumber;
            set => pageNumber = value > 0 ? value : 1;
        }

        /// <summary>
        /// 行数(默认 15)
        /// </summary>
        public int PageSize
        {
            get => pageSize;
            set => pageSize = value > 0 ? value : 15;
        }

        /// <summary>
        /// 参数主体
        /// </summary>
        public T Body { get; set; } = new T();
    }
}
